# _*_ coding: utf-8 _*_
# @Time : 2024-01-16 22:21
# @Author : wf

import urllib.request

url = 'https://2023.ip138.com/'
headers = {
    'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36'
}

request = urllib.request.Request(url, headers=headers)

# 快代理
# 使用代理
proxies = {
    'http': '42.249.188.197:17514',
    # 'http': '221.227.224.243:20547',

}
# handler
handler = urllib.request.ProxyHandler(proxies=proxies)
opener = urllib.request.build_opener(handler)
res = opener.open(request)
content = res.read().decode('utf-8')
print(content)

